home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
rjcom.exe
/
INT_14.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-19
|
8KB
|
173 lines
/**************************************************************************************************
*
* Title: INT_14.H
*
* This is an include file for prototypes and value definitions with regard to serial
* communications. The serial functions can be accessed in two ways:
*
* (1) The file is linked with CCOM.OBJ which accesses the serial ports directly.
*
* (2) The file is linked with INT_14.OBJ which accesses the serial ports indirectly
* through INT-14. Prior to running the finished executable, the user must run
* the COM_TSR.COM serial driver which replaces and extends the standard INT-14
* functions.
*
**************************************************************************************************/
#define _INT_14_H_
/**************************************************************************************************
*
* Function calling parameter definitions
*
**************************************************************************************************/
#define COM1 0 /* Defines the first serial port */
#define COM2 1 /* Defines the second serial port */
#define COM3 2 /* Defines the third serial port */
#define COM4 3 /* Defines the fourth serial port */
#define COM5 4 /* Defines the fifth serial port */
#define COM6 5 /* Defines the sixth serial port */
#define COM7 6 /* Defines the seventh serial port */
#define COM8 7 /* Defines the eighth serial port */
#define LENGTH8 8 /* Defines an 8-bit data character */
#define LENGTH7 7 /* Defines a 7-bit data character */
#define LENGTH6 6 /* Defines a 6-bit data character */
#define LENGTH5 5 /* Defines a 5-bit data character */
#define ONE_STOP_BIT 1 /* Defines a single stop bit */
#define TWO_STOP_BIT 2 /* Defines two stop bits */
#define NO_PARITY 0 /* Defines a no parity transmission/reception */
#define ODD_PARITY 1 /* Defines an odd parity transmission/reception */
#define EVEN_PARITY 2 /* Defines an even parity transmission/reception */
#define COM_VERIFY 1 /* Used for verifying the condition of the COM port from COM_INIT() */
#define COM_NO_VERIFY 0 /* Used for not verifying the condition of the COM port from COM_INIT() */
/**************************************************************************************************
*
* Status values returned by COM_STATUS()
* Bit 15 is not defined because that would indicate an error condition
*
**************************************************************************************************/
#define COM_CHANGE_CTS 0x0001 /* Change seen in Clear to Send, will not occur */
#define COM_CHANGE_DSR 0x0002 /* Change seen in Data Set Ready, will not occur */
#define COM_CHANGE_RI 0x0004 /* Change seen in Ring Indicator, will not occur */
#define COM_CHANGE_DCD 0x0008 /* Change seen in Data Carrier Detect, will not occur */
#define COM_CTS 0x0010 /* Clear to Send asserted */
#define COM_DSR 0x0020 /* Data Set Ready asserted */
#define COM_RI 0x0040 /* Ring Indicator asserted */
#define COM_DCD 0x0080 /* Data Carrier Detect asserted */
#define COM_DATA_READY 0x0100 /* Data ready in input buffer */
#define COM_DATA_OVERRUN 0x0200 /* Previous byte recv'd was overwritten */
#define COM_PARITY_ERROR 0x0400 /* Parity error was detected */
#define COM_FRAME_ERROR 0x0800 /* Transmission is out of sync */
#define COM_BREAK_DETECT 0x1000 /* BREAK was sent from the remote */
#define COM_XMIT_EMPTY 0x2000 /* Transmission register is empty */
#define COM_SHIFT_EMPTY 0x4000 /* Transmission shift register is empty */
/**************************************************************************************************
*
* ERROR CONDITIONS
*
**************************************************************************************************/
#define ILLEGAL_COM_PORT -1 /* COM number not supported */
#define HARD_COM_ERROR -2 /* Hardware error occurred during operation */
#define OUTPUT_QUEUE_FULL -3 /* Output queue was full */
#define NOT_ENOUGH_BYTES -4 /* Not enough bytes in the input queue */
#define ERR_NO_HANGUP -9 // The hangup was not successful
/**************************************************************************************************
*
* SPECIAL CHARACTERS
*
**************************************************************************************************/
#define XON 0x11
#define XOFF 0x13
/**************************************************************************************************
*
* VARIOUS EXTERNAL ROUTINES
*
**************************************************************************************************/
extern unsigned short Com_Timer_Tick, _Xon_Percent, _Xoff_Percent, Com_Xfer_Timeout, _Cprint_Cn;
extern unsigned short _Com_Error_Count[8];
extern unsigned short _Com_Cn, _Com_Cprint_Output;
extern unsigned long _Com_Total_In, _Com_Total_Out;
/**************************************************************************************************
*
* VARIOUS EXTERNAL ROUTINES
*
**************************************************************************************************/
extern short com_init( unsigned short, unsigned long, unsigned char, unsigned char, unsigned char, unsigned short );
extern short com_set_baud( unsigned short, unsigned long );
extern short com_set_datasize( unsigned short, unsigned char, unsigned char, unsigned char, unsigned char );
extern short com_start( unsigned short );
extern short com_stop( unsigned short );
extern short com_get_settings( unsigned short, unsigned long *, unsigned char *, unsigned char *, unsigned char * );
extern short com_out( unsigned short, unsigned char );
extern short com_in( unsigned short );
extern short com_status( unsigned short );
extern unsigned short com_qin( unsigned short );
extern unsigned short com_qout( unsigned short );
extern unsigned short com_ein( unsigned short );
extern unsigned short com_eout( unsigned short );
extern short com_sout( unsigned short, unsigned char far * );
extern short com_snout( unsigned short, void far *, unsigned short );
extern unsigned short com_sin( unsigned short, unsigned char far * );
extern unsigned short com_snin( unsigned short, void far *, unsigned short );
extern short com_drop_dtr( unsigned short );
extern short com_assert_dtr( unsigned short );
extern short com_drop_rts( unsigned short );
extern short com_assert_rts( unsigned short );
extern short com_start_xonxoff( unsigned short );
extern short com_stop_xonxoff( unsigned short );
extern short com_start_hard( unsigned short );
extern short com_stop_hard( unsigned short );
extern short com_clear_input( unsigned short );
extern short com_clear_output( unsigned short );
extern short com_set_output( unsigned short, void far *, unsigned short );
extern short com_set_input( unsigned short, void far *, unsigned short );
extern short com_restore_output( unsigned short );
extern short com_restore_input( unsigned short );
//extern short com_set_dsr_vector( unsigned short, unsigned short (*)() );
//extern short com_set_ri_vector( unsigned short, unsigned short (*)() );
//extern short com_set_carrier_vector( unsigned short, unsigned short (*)() );
extern short com_set_dsr_vector( unsigned short, unsigned char far * );
extern short com_set_ri_vector( unsigned short, unsigned char far * );
extern short com_set_carrier_vector( unsigned short, unsigned char far * );
extern unsigned short com_version( void );
extern short com_set_port( unsigned short, unsigned short );
extern short com_set_irq( unsigned short, unsigned short );
extern short com_send_command( unsigned short, unsigned char * );
extern short com_pulse_dtr( unsigned short, unsigned short );
extern short cprint( char *, ... );
extern short com_hangup( unsigned short );